#include <iostream>
#include "Student.h"
#include "SortTestHelper.h"
#include "Sortfunction.h"

using namespace std;

int main() {

    int n = 50000;
    int *arr1 = SortTestHelper::generateRandomArray(n, 0, 3);
    int *arr2 = SortTestHelper::copyIntArray(arr1, n);
    int *arr3 = SortTestHelper::generateNearlyOrderedArray(n, 100);
    int *arr4 = SortTestHelper::copyIntArray(arr1, n);
    SortTestHelper::testSort("Selection Sort", selectionSort, arr1, n);
    //SortTestHelper::testSort("Bubble Sort", BubbleSort, arr2, n);
    SortTestHelper::testSort("insertion Sort", insertionSort, arr2, n);
    // 改进
    SortTestHelper::testSort("insertion Sort1", insertionSort1, arr3, n);
    // 归并
    SortTestHelper::testSort("Merge Sort", MergeSort, arr4, n);

    
    delete[] arr1;
    delete[] arr2;
    delete[] arr3;
    delete[] arr4;

    // // 测试模板函数，传入整型数组
    // int a[10] = {10,9,8,7,6,5,4,3,2,1};
    // selectionSort( a , 10 );
    // for( int i = 0 ; i < 10 ; i ++ )
    //     cout<<a[i]<<" ";
    // cout<<endl;

    // // 测试模板函数，传入浮点数数组
    // float b[4] = {4.4,3.3,2.2,1.1};
    // selectionSort(b,4);
    // for( int i = 0 ; i < 4 ; i ++ )
    //     cout<<b[i]<<" ";
    // cout<<endl;

    // // 测试模板函数，传入字符串数组
    // string c[4] = {"D","C","B","A"};
    // selectionSort(c,4);
    // for( int i = 0 ; i < 4 ; i ++ )
    //     cout<<c[i]<<" ";
    // cout<<endl;

    // // 测试模板函数，传入自定义结构体Student数组
    // Student d[4] = { {"D",90} , {"C",100} , {"B",95} , {"A",95} };
    // selectionSort(d,4);
    // for( int i = 0 ; i < 4 ; i ++ )
    //     cout<<d[i];
    // cout<<endl;

    return 0;
}